Skip to content

Instantly share code, notes, and snippets.

@AlexKobachiJP
AlexKobachiJP / XcodeCommand
Last active June 1, 2024 20:26
Sort file and package references in an Xcode project.
// Copyright © 2023 Alex Kovács. All rights reserved.
import ArgumentParser
import Foundation
import PathKit
import XcodeProj
// See below for `MainCommand` skeleton.
extension MainCommand {
struct XcodeCommand: ParsableCommand {
@SkyN9ne
SkyN9ne / amsi-bypass.ps1
Last active June 1, 2024 20:25 — forked from FatRodzianko/my-am-bypass.ps1
small modification to Rastemouse's AmsiScanBuffer bypass to use bytes. Uses different opcode bytes
$Win32 = @"
using System;
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("kernel32")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
[DllImport("kernel32")]
@ereli
ereli / countries.sql
Last active June 1, 2024 20:24 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes. PostgreSQL compatible
CREATE SEQUENCE country_seq;
CREATE TABLE IF NOT EXISTS country (
id int NOT NULL DEFAULT NEXTVAL ('country_seq'),
iso char(2) NOT NULL,
name varchar(80) NOT NULL,
nicename varchar(80) NOT NULL,
iso3 char(3) DEFAULT NULL,
numcode smallint DEFAULT NULL,
phonecode int NOT NULL,
@FatRodzianko
FatRodzianko / my-am-bypass.ps1
Last active June 1, 2024 20:24
small modification to Rastemouse's AmsiScanBuffer bypass to use bytes. Uses different opcode bytes
$Win32 = @"
using System;
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("kernel32")]
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
[DllImport("kernel32")]
@adamsvoboda
adamsvoboda / vivaldi.md
Last active June 1, 2024 20:24
removes the vivaldi menu button and the padding on top of tabs, also moves down the tab group indicator so its visible after doing this
  1. open your vivaldi browser.html file: %LOCALAPPDATA%\Vivaldi\Application\1.0.435.42\resources\vivaldi (replace 1.0.435.42 with your version)

  2. add the following code under <link rel="stylesheet" href="style/common.css" />

<style>
  .vivaldi { display: none !important; }
  #tabs-container.top { padding-top: 0px !important;  padding-left: 0px !important; }
  .tab-group-indicator { top: -3px !important; }
-- For the animation, run with the love2d game engine
-- For the SVG output, run with the standard Lua interpreter
local narrow = false -- Change this to true to fold around the narrow angle instead of the wide one
local size = 14 -- This is the number of hexes on the side of the flat rhombus
local base_hex = {}
local s32 = math.sqrt(3)/2
local rad = 1/math.sqrt(3)
@deepak-cotocus
deepak-cotocus / Laravel-Queue-Supervisor-configuration.md
Last active June 1, 2024 20:23
Laravel Queue Supervisor configuration

How to use Supervisor:A Process Control System for Laravel queue In Linux based OS

What is Supervisor: A Process Control System?

Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems. Supervisor provides you with one place to start, stop, and monitor your processes. Processes can be controlled individually or in groups. You can configure Supervisor to provide a local or remote command line and web interface.


Why do we use Supervisor for Larave Queue?

The supervisor is a process manager which Laravel suggests to use as a process monitor for queue workers. It will automatically start the queue worker in the background, even after the system has booted and will automatically restart the worker if the worker exits unexpectedly.

/* ESP32-S2 (beta) "dedicated GPIO" peripheral example */
#include <stdio.h>
#include "sdkconfig.h"
#include "soc/system_reg.h"
#include "esp32s2beta/rom/gpio.h"
#include "soc/gpio_sig_map.h"
#include "driver/gpio.h"
/* The header file is not yet in IDF; however this is the only register we need. */
@bibendi
bibendi / Get started with local and remote LLM GPT.md
Last active June 1, 2024 20:16
Get started with local and remote LLM GPT.md

[[GPT]] Гайд для тех, кто не хочет делиться своими данными при общении с AI чатами или сэкономить 20 баксов на подписку, а тратить не больше 5 в крипте. То есть с LLM моделя можно работать как полностью локально (важна оперативка), либо через провайдера OpenRouter.

Local

Для работа offline с [[LLM]] модели вам нужно следующее:

  • Сначала немного теории. Что такое [[LLM]] модели https://www.youtube.com/watch?v=zjkBMFhNj_g
  • Устанавливаем Ollama сервер. Это как Docker, только для моделей
    • Скачиваем сервере с https://ollama.com/
    • Выбираем модель https://ollama.com/library и скачиваем ее. Если у вас не более 16Gb RAM, то я рекомендую wizardlm2:7b. Это супер новая модель, примерно сопоставимая с chatGPT 3.5.
    • Команда следующая: ollama run wizardlm2:7b-q5_K_M. После скачивания запуститься промт, в котором можно проверить модель, ну либо сразу закрыть. На верхней панели должна появиться иконка с запущенной ламой.
  • Чтобы взаимодействовать с моделью далее нужно установить клиент. Их есть два вида: webU
@mabenson00
mabenson00 / cheatsheet.rb
Last active June 1, 2024 20:06
Rails ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today